﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;

namespace VisualTest2.Drawings
{
    public class PoliElement : FrameworkElement
    {
        private int point_count = 1;
        private Size size = new Size(0, 0);
        private PointCollection pointCollection = null;
        public PointCollection PointCollection
        {
            get { return pointCollection; }
            set { pointCollection = value; }
        }
        public PoliElement(int pointCount, Size size)
        {
            this.point_count = pointCount;
            this.size = size;
        }
        protected override void OnRender(DrawingContext drawingContext)
        {
            Pen drawingPen = new Pen(Brushes.Black, 1);
            //PointOperations ops = new PointOperations();
            //pointCollection = ops.createRandomCollection(size, point_count);

            for (int i = 0; i < pointCollection.Count - 1; i++)
            {
                drawingContext.DrawLine(drawingPen, pointCollection[i], pointCollection[i + 1]);
            }
            base.OnRender(drawingContext);
        }
    }
}
